/**
 * @file vuex store主文件
 * @author fanxingguang@baidu.com
 */
import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

const state = {
    isScrollDown: false,
    pageTitle: 'RENEW',
    pageSubtitle: '',
    navActiveIndex: 0
};
const mutations = {
    setIsScrollDown(state, isScrollDown) {
        state.isScrollDown = isScrollDown;
    },
    setPageTitle(state, pageTitle) {
        state.pageTitle = pageTitle;
    },
    setPageSubtitle(state, pageSubtitle) {
        state.pageSubtitle = pageSubtitle;
    },
    setNavActiveIndex(state, index) {
        state.navActiveIndex = index;
    }
};

const actions = {};

export default new Vuex.Store({
    state,
    mutations,
    actions,
    getters: {
        isScrollDown: state => state.isScrollDown,
        pageTitle: state => state.pageTitle,
        pageSubtitle: state => state.pageSubtitle
    }
});
